home *** CD-ROM | disk | FTP | other *** search
- Path: news.ox.ac.uk!news
- From: imc@ecs.ox.ac.uk (Ian Collier)
- Newsgroups: comp.lang.rexx,comp.lang.perl.misc
- Subject: Re: Perl to Rexx Conversion
- Date: 8 Jan 1996 16:57:54 GMT
- Organization: Oxford University Computing Laboratory
- Distribution: inet
- Message-ID: <7600.imc@comlab.ox.ac.uk>
- References: <4aq2ad$drl@ccnet2.ccnet.com> <4at9hp$r5m@picasso.op.net> <7580.imc@comlab.ox.ac.uk> <4b5cmg$474@csnews.cs.colorado.edu>
- NNTP-Posting-Host: boothp2.ecs.ox.ac.uk
- X-Local-Date: Monday, 8th January 1996 at 4:57pm GMT
-
- Well it's been a while but I haven't seen a detailed answer to this so
- here goes. (Actually I did reply to the email copy of this but it got
- returned a few days ago, so this is more or less the same as that).
-
- In article <4b5cmg$474@csnews.cs.colorado.edu>, Tom Christiansen
- <tchrist@mox.Perl.com> writes:
- > [courtesy cc of this posting sent to cited author via email]
- [obviously I haven't bothered resending this by email :-) ]
-
- > In comp.lang.Perl.misc,
- > imc@ecs.ox.ac.uk (Ian Collier) writes:
-
- > Nonetheless, Rexx is not so clearly a structured programming language,
- > you know. What about this:
- >
- > do i=1 to 10
- > if i<8 then
- > iterate i
- > else
- > signal somewhere
- >
- > somewhere:
-
- Ahem, you can write spaghetti code in almost any language! That doesn't
- prove much. For what it's worth, "signal" is supposed to be for an
- *abnormal* change in the flow of control and is deprecated as a "goto"
- instruction. You cannot, for example, jump to a point that is inside a
- loop (even the same one that you are in at the moment) and expect it to
- continue looping.
-
- > Since you bring up the matter, I was wondering about a few things:
-
- As you probably know, Rexx has been fixed by an ANSI standard at
- approximately the level it was at in 1990 with a few small extensions.
- Object Rexx has been developed by IBM and is in beta testing (a public
- beta is on IBM's DevCon CD). IBM plans to release a free source code
- version of Object Rexx for Linux. I have seen demonstrations, but I
- have not used the product.
-
- > Have they nailed down what lines() does yet, or is it still challenging
- > to check for eof()? Can you explicitly open() and close() files and
- > pipes yet?
-
- The standard specifies an action for lines(), although it will be some
- time before the majority of implementations become conforming. There
- is no standard way to open and close files, though the stream() function
- provides a hook for the implementor to provide this, and the OS/2 syntax
- will probably become a defacto standard. Checking for eof is still messy,
- though it can be done for example by calling stream() to get the file's
- status.
-
- > Is it easy to load various and multiple functions from other files
- > yet?
-
- If these files are Rexx files and if you want more than one of them in a
- file, then the answer is no, unless you are using Object Rexx, in which
- case I believe you can.
-
- > Does Rexx have lexical scoping yet, or is all dynamic still?
-
- I think one would say it is all dynamic, although in most programs it is
- hard to tell the difference.
-
- > What about real arrays? I don't just mean using word() or words() or
- > wordposs() and splitting on nothing but white space. I mean real first
- > class lists. It would also be nice to split on a pattern, like say
- > /\s*[;,]\s*/. Can you sort your arrays?
-
- Object Rexx has array objects but I don't know much about them. I assume
- operations like split, join and sort are possible on these but I've no idea
- whether they are built in.
-
- > Are there associative arrays yet? Do you have things like keys(),
- > values(), each(), defined(), exists(), and delete()? What about
- > defining a key retrieval ordering?
-
- Associative arrays have always existed, as has defined() (though it is
- called symbol()). It has always been possible to delete variables (or
- elements of an associative array) using the drop instruction. Exists()
- I've never heard of. Object Rexx has a "do over" construction which could
- be used to emulate the others. It works for all kinds of objects, not just
- associative arrays.
-
- > Can you pass things by reference or by value at your discretion?
- > Is this implicit or explicit?
-
- Object Rexx has argument passing by reference. The caller has no special
- syntax but the callee uses different syntaxes depending on whether it wants
- the parameters by value or by reference. Of course the only way to pass a
- complex object like an associative array is by reference.
-
- > Does it have regexps yet or is it just that clunky parse stuff?
-
- No regexps, I'm afraid. Some day, someone somewhere will write some. Until
- then, parse isn't _that_ bad.
-
- > Can you dynamically load C functions? Can you test for whether
- > a function is defined or not?
-
- There is no standard syntax for doing it while the Rexx program is
- running, but several implementations provide some. The OS/2 syntax
- will again probably prevail. It is also specified in the standard that
- the interpreter should have an API which allows the programmer to add some
- functions to the interpreter before starting it up. The API has a routine
- which tests whether a function has been dynamically loaded; this call is
- also available to the OS/2 Rexx programmer.
-
- Ian Collier - imc@comlab.ox.ac.uk - WWW Home Page (including REXX section):
- http://www.comlab.ox.ac.uk/oucl/users/ian.collier/index.html
-